package com.carpedil.common.socket;

import com.alibaba.fastjson.JSON;
import com.carpedil.common.dto.OrderDTO;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

/** @author Administrator */
public class OrderEncoder implements Encoder.Text<OrderDTO> {

  @Override
  public String encode(OrderDTO dto) throws EncodeException {
    return JSON.toJSONString(dto);
  }

  @Override
  public void init(EndpointConfig endpointConfig) {}

  @Override
  public void destroy() {}
}
